﻿using BasicInformation.Domain;
using BasicInformation.Infrastructure.Interface;
using BasicInformation.ReadAPI.Application.Command.FuelCostsCommand;
using MediatR;

namespace BasicInformation.ReadAPI.Application.CommandHandler.FuelCostsCommandHandler
{
    public class FuelCostsInfoCommandHandler : IRequestHandler<FuelCostsInfoCommand, FuelCosts>
    {
        private readonly IFuelCostsRepository fuelCostsRepository;

        public FuelCostsInfoCommandHandler(IFuelCostsRepository fuelCostsRepository)
        {
            this.fuelCostsRepository = fuelCostsRepository;
        }
        public async Task<FuelCosts> Handle(FuelCostsInfoCommand request, CancellationToken cancellationToken)
        {
            var info = await fuelCostsRepository.Get(request.Id);
            return info;
        }
    }
}
